package gui;

import gameObjects.GameObject;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class GuiObject extends JLabel implements Comparable<GuiObject>{

	private static final long serialVersionUID = 1L;
	private GameObject gameObject;
	public static final int H_SIZE =32;
	public static final int W_SIZE =32;
	private int id;

	public GuiObject(GameObject gameObject) {
		super(new ImageIcon(gameObject.getImageString()));
		this.id=gameObject.getId();
		this.gameObject = gameObject;


	}

	public GuiObject(GameObject gameObject, ImageIcon icon) {
		super(icon);
		this.id=gameObject.getId();
		this.gameObject = gameObject;

	}

	public GameObject getGameObject() {
		return gameObject;
	}


	public void setGameObject(GameObject gameObject) {
		this.gameObject = gameObject;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}


	public int compareTo(GuiObject obj) {

		return this.id - obj.getId();
	}





}
